package com.shelpe.serivces.conf.git;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.config.environment.Environment;
import org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository;
import org.springframework.core.env.ConfigurableEnvironment;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CachableMultipleJGitEnvironmentRepository extends MultipleJGitEnvironmentRepository {

	public CachableMultipleJGitEnvironmentRepository(ConfigurableEnvironment environment) {
		super(environment);
	}

	@Override
	@Cacheable(value="git")
	public Environment findOne(String application, String profile, String label) {
		log.debug("from git: {}, {}, {}", application, profile, label);
		return super.findOne(application, profile, label);
	}

}
